bool Add(T item) |
Add an item to end of this list.
Returns: | True | Parameters: | item: | The item to add. |
|
void AddAll<U>(IEnumerable<U> items) |
Add the elements from another collection to this collection.
Type parameters: | | U | | Constraints: | | | U : T |
|
bool Check() |
Check the integrity of the internal data structures of this array list.
Returns: | True if check does not fail. |
|
void Clear() |
Remove all items from this collection, resetting internal array size.
|
object Clone() |
Make a shallow copy of this ArrayList.
|
bool Contains(T item) |
Check if this collection contains (an item equivalent to according to the
itemequalityComparer) a particular value.
Returns: | True if the items is in this collection. | Parameters: | item: | The value to check for. |
|
bool ContainsAll<U>(IEnumerable<U> items) |
Check if this collection contains all the values in another collection,
taking multiplicities into account.
Current implementation is not optimal.
Type parameters: | | U | | Constraints: | | | U : T |
Returns: | True if all values in items is in this collection. | Parameters: | items: | The |
|
int ContainsCount(T item) |
Count the number of items of the collection equal to a particular value.
Returns 0 if and only if the value is not in the collection.
Returns: | The number of copies found. | Parameters: | item: | The value to count. |
|
T Dequeue() |
Dequeue an item from the front of the queue.
|
void Dispose() |
Invalidate this list. If a view, just invalidate the view.
If not a view, invalidate the list and all views on it.
|
void Enqueue(T item) |
Enqueue an item at the back of the queue.
|
P void expand() |
Double the size of the internal array.
|
P void expand(int newcapacity, int newsize) |
Expand the internal array, resetting the index of the first unused element.
Parameters: | newcapacity: | The new capacity (will be rouded upwards to a power of 2). | newsize: | The new count of |
|
bool Find(ref T item) |
Check if this collection contains an item equivalent according to the
itemequalityComparer to a particular value. If so, return in the ref argument (a
binary copy of) the actual value found.
Returns: | True if the items is in this collection. | Parameters: | item: | The value to look for. |
|
IList<T> FindAll(Fun<T,bool> filter) |
Create a new list consisting of the items of this list satisfying a
certain predicate.
The new list will be of type ArrayList Returns: | The new list. | Parameters: | filter: | The filter delegate defining the predicate. |
|
bool FindOrAdd(ref T item) |
Check if this collection contains an item equivalent according to the
itemequalityComparer to a particular value. If so, return in the ref argument (a
binary copy of) the actual value found. Else, add the item to the collection.
Returns: | True if the item was found (hence not added). | Parameters: | item: | The value to look for. |
|
System.Collections.Generic.IEnumerator<T> GetEnumerator() |
Create an enumerator for the collection
|
int GetUnsequencedHashCode() | |
int IndexOf(T item) |
Search for an item in the list going forwrds from the start.
Returns: | Index of item from start. | Parameters: | item: | Item to search for. |
|
P void insert(int i, T item) |
Internal version of Insert with no modification checks.
Parameters: | i: | Index to insert at | item: | Item to insert |
|
void Insert(int index, T item) |
Insert an item at a specific index location in this list.
Throws | | System.IndexOutOfRangeException | if i is negative or
> the size of the collection. |
Parameters: | index: | The index at which to insert. | item: | The item to insert. |
|
F void Insert(IList<T> pointer, T item) |
Insert an item at the end of a compatible view, used as a pointer.
The pointer must be a view on the same list as
this and the endpoitn of pointer must be
a valid insertion point of this Throws | | IncompatibleViewException | If pointer
is not a view on or the same list as this | System.IndexOutOfRangeException | ?????? if the endpoint of
pointer is not inside this | DuplicateNotAllowedException | if the list has
AllowsDuplicates==false and the item is
already in the list. |
|
void InsertAll<U>(int index, IEnumerable<U> items) |
Insert into this list all items from an enumerable collection starting
at a particular index.
Throws | | System.IndexOutOfRangeException | if index is negative or
> the size of the collection. |
Type parameters: | | U | | Constraints: | | | U : T |
Parameters: | index: | Index to start inserting at | items: | Items to insert |
|
void InsertFirst(T item) |
Insert an item at the front of this list;
Parameters: | item: | The item to insert. |
|
void InsertLast(T item) |
Insert an item at the back of this list.
Parameters: | item: | The item to insert. |
|
F bool IsSorted() |
Check if this list is sorted according to the default sorting order
for the item type T, as defined by the Comparer<T> class
Returns: | True if the list is sorted, else false. |
|
bool IsSorted(System.Collections.Generic.IComparer<T> c) |
Check if this list is sorted according to a specific sorting order.
Returns: | True if the list is sorted, else false. | Parameters: | c: | The comparer defining the sorting order. |
|
ICollectionValue<KeyValuePair<T,int>> ItemMultiplicities() | |
int LastIndexOf(T item) |
Search for an item in the list going backwords from the end.
Returns: | Index of item from the end. | Parameters: | item: | Item to search for. |
|
IList<T> LastViewOf(T item) |
Create a list view on this list containing the last occurrence of a particular item.
Returns null if the item is not in this list. Returns: | The new list view. | Parameters: | item: | The item to find. |
|
IList<V> Map<V>(Fun<T,V> mapper) |
Create a new list consisting of the results of mapping all items of this
list. The new list will use the default item equalityComparer for the item type V.
The new list will be of type ArrayList Type parameters: | | V | The type of items of the new list |
Returns: | The new list. | Parameters: | mapper: | The delegate defining the map. |
|
IList<V> Map<V>(Fun<T,V> mapper, System.Collections.Generic.IEqualityComparer<V> itemequalityComparer) |
Create a new list consisting of the results of mapping all items of this
list. The new list will use a specified item equalityComparer for the item type.
The new list will be of type ArrayList Type parameters: | | V | The type of items of the new list |
Returns: | The new list. | Parameters: | mapper: | The delegate defining the map. | itemequalityComparer: | The item equalityComparer to use for the new list |
|
P void modifycheck(int stamp) |
Check that the list has not been updated since a particular time.
To be used by enumerators and range Parameters: | stamp: | The stamp indicating the time. |
|
T Pop() |
Pop the item at the top of the stack from the stack.
|
void Push(T item) |
Push an item to the top of the stack.
|
T Remove() |
Remove one item from the list: from the front if FIFO
is true, else from the back.
Returns: | The removed item. |
|
bool Remove(T item) |
Remove a particular item from this list. The item will be searched
for from the end of the list if FIFO == false (the default),
else from the start.
Returns: | True if the item was found (and removed). | Parameters: | item: | The value to remove. |
|
bool Remove(T item, out T removeditem) |
Remove the first copy of a particular item from this collection if found.
If an item was removed, report a binary copy of the actual item removed in
the argument. The item will be searched
for from the end of the list if FIFO == false (the default),
else from the start.
Returns: | True if the item was found (and removed). | Parameters: | item: | The value to remove. | removeditem: | The removed value. |
|
void RemoveAll<U>(IEnumerable<U> items) |
Remove all items in another collection from this one, taking multiplicities into account.
Matching items will be removed from the front. Current implementation is not optimal.
Type parameters: | | U | | Constraints: | | | U : T |
Parameters: | items: | The items to remove. |
|
void RemoveAllCopies(T item) |
Remove all items equal to a given one.
Parameters: | item: | The value to remove. |
|
T RemoveAt(int index) |
Remove the item at a specific position of the list.
Throws | | System.IndexOutOfRangeException | if index is negative or
>= the size of the collection. |
Returns: | The removed item. | Parameters: | index: | The index of the item to remove. |
|
T RemoveFirst() |
Remove one item from the fromnt of the list.
Returns: | The removed item. |
|
void RemoveInterval(int start, int count) |
Remove all items in an index interval.
Throws | | System.ArgumentOutOfRangeException | If start
and count does not describe a valid interval in the list |
Parameters: | start: | The index of the first item to remove. | count: | The number of items to remove. |
|
T RemoveLast() |
Remove one item from the back of the list.
Returns: | The removed item. |
|
void RetainAll<U>(IEnumerable<U> items) |
Remove all items not in some other collection from this one, taking multiplicities into account.
Items are retained front first.
Type parameters: | | U | | Constraints: | | | U : T |
Parameters: | items: | The items to retain. |
|
void Reverse() |
Reverst the list so the items are in the opposite sequence order.
|
void Shuffle() |
Randomly shuffle the items of this list.
|
void Shuffle(System.Random rnd) |
Shuffle the items of this list according to a specific random source.
Parameters: | rnd: | The random source. |
|
IList<T> Slide(int offset) |
Slide this list view along the underlying list.
Throws | | NotAViewException | if this list is not a view. | System.ArgumentOutOfRangeException | if the operation
would bring either end of the view outside the underlying list. |
Parameters: | offset: | The signed amount to slide: positive to slide
towards the end. |
|
IList<T> Slide(int offset, int size) |
Slide this list view along the underlying list, changing its size.
Throws | | NotAViewException | if this list is not a view. | System.ArgumentOutOfRangeException | if the operation
would bring either end of the view outside the underlying list. |
Parameters: | offset: | The signed amount to slide: positive to slide
towards the end. | size: | The new size of the view. |
|
void Sort() |
Sort the items of the list according to the default sorting order
for the item type T, as defined by the Comparer[T] class
(Comparer<T>).
Throws | | System.InvalidOperationException | if T is not comparable |
|
void Sort(System.Collections.Generic.IComparer<T> comparer) |
Sort the items of the list according to a specific sorting order.
Parameters: | comparer: | The comparer defining the sorting order. |
|
IList<T> Span(IList<T> otherView) | Returns null if otherView is strictly to the left of this view Returns: | | Parameters: | otherView: | |
|
bool TrySlide(int offset) | Returns: | | Parameters: | offset: | |
|
bool TrySlide(int offset, int size) | Returns: | | Parameters: | offset: | | size: | |
|
ICollectionValue<T> UniqueItems() | |
bool UnsequencedEquals(ICollection<T> that) | |
bool Update(T item) |
Check if this collection contains an item equivalent according to the
itemequalityComparer to a particular value. If so, update the item in the collection
to with a binary copy of the supplied value. This will only update the first
mathching item.
Returns: | True if the item was found and hence updated. | Parameters: | item: | Value to update. |
|
bool Update(T item, out T olditem) | Returns: | | Parameters: | item: | | olditem: | |
|
P void updatecheck() |
Check if it is valid to perform updates and increment stamp if so.
|
bool UpdateOrAdd(T item) |
Check if this collection contains an item equivalent according to the
itemequalityComparer to a particular value. If so, update the item in the collection
to with a binary copy of the supplied value. This will only update the first
mathching item.
Returns: | True if the item was found and hence updated. | Parameters: | item: | Value to update. |
|
bool UpdateOrAdd(T item, out T olditem) | Returns: | | Parameters: | item: | | olditem: | |
|
IList<T> View(int start, int count) |
Create a list view on this list.
Throws | | System.ArgumentOutOfRangeException | if the start or count is negative
or the range does not fit within list. |
Returns: | The new list view. | Parameters: | start: | The index in this list of the start of the view. | count: | The size of the view. |
|
IList<T> ViewOf(T item) |
Create a list view on this list containing the (first) occurrence of a particular item.
Returns null if the item is not in this list. Returns: | The new list view. | Parameters: | item: | The item to find. |
|